package com.igor.reporting.pages.location;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.igor.reporting.dao.location.LocationDAO;
import com.igor.reporting.entities.location.Location;

public class Edit {

	@Inject
	private LocationDAO LocationDAO;

	@Property
	@Persist
	private Location location;

	void onActivate(Long id) {
		location = LocationDAO.find(id);
	}

	Object onSuccess() {
		LocationDAO.update(location);
		return Browse.class;
	}
}
